Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Every page starts with:
- <?php
- require $_SERVER['DOCUMENT_ROOT'] . '/min/page.php';
- ?>
- Then you can add paths to scripts and stylesheets to be included. It can be one of following, all having their css counterparts.
- Minify::IncludeJs(string script);
- Minify::IncludeJs(array scripts);
- Minify::IncludeJs(string tag, string script); // Tag is to choose later on
- Minify::IncludeJs(string tag, array stylesheets); // which files to include where
- Examples:
- <?
- Minify::IncludeJs(array(
- "/my/jquery/script.js",
- "/my/own/script.js"
- ));
- Minify::IncludeCss(array(
- "/my/base/stylesheet.css",
- "/my/page/stylesheetcss"
- ));
- Inline you use the following codes to give the reference tags a place, all having their css counterparts:
- Minify::Js(); // Places the included, nontagged files, with script tags, html version to be set in config.
- Minify::Js(bool all); // Same as first, but tagged too when true.
- Minify::Js(string tag); // Same as first, but with the tagged files.
- Minify::Js(array tags); // Same as above, but with multiple tags.
- Minify::JsNow(string script); // Compresses and places the script.
- Minify::JsNow(array scripts); // Compresses and places the scripts.
- // All have optional int spreading = 2
- // The spreading param makes the scripts to be spread over `spreading` files, to use the HTTP asynchronous loading capability which defaults to 2 at a time.
- Examples:
- <?php
- Minify::JsNow(array(
- "/my/jquery/script.js",
- "/my/own/script.js"
- ), 1);
- Minify::CssNos(array(
- "/my/base/stylesheet.css",
- "/my/page/stylesheetcss"
- ), 1);
- Minify::Js("globalfiles"); // Include some globaly defined files.
- Minify::Css("globalfiles");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement